home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 43
/
Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso
/
-serious-
/
comms
/
other
/
ftransapiv
/
arexx
/
ftranswordworth.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-06-14
|
4KB
|
130 lines
/*
-------------------------------------------
WordWorth Translator By FTranslator Client
Script by Cristian Robert Gallas
Tested with WordWorth 7
Usage:
Use in ARexx interface of WordWorth
$VER: FTransWORDWORTH.rexx v0.01 (15.08.96)
-------------------------------------------
HISTORY
----------------------------------------
v0.01b [15.08.98] - First public beta version.
----------------------------------------
[Steps installation]
> Copy FTransWORDWORTH.rexx to WordWorth:WwRexx/
> Go to Tools/ARexx Macros...
> Click ADD and select FTransWORDWORTH.rexx
> Select Close
> Select Text
> Go to Tools/ARexx Macros...
> Select FTransWORDWORTH.rexx and click PLAY
> Its open new window with translation... :)
0 - English to Francais
1 - English to Deutsch
2 - English to Italiano
3 - English to Portugues
4 - English to Espanol
5 - Francais to English
6 - Deutsch to English
7 - Italiano to English
8 - Espanol to English
9 - Portugues to English
*/
Options Results
tmpfile = 'Ram:FTransTmp.WORDWORTH'
tmpclip = 'Ram:FTransWordWorth.Clip'
ARG traduz
/* TESTA SE PODE SER USADAS AS LIBS DO AREXX */
if ~show(l, "rexxsupport.library") then
if ~addlib("rexxsupport.library", 0, -30) then
exit
if ~show(l, "rexxtricks.library") then
if ~addlib("rexxtricks.library", 0, -30) then
exit
/* TESTA SE O PROGRAMA JA NAO ESTA COM A PORTA DE TRADUCAO ABERTA */
if exists(tmpfile) then do
RequestNotify 'FTranslation port is open! Translation in progress, wait...'
exit
end
COPY
/* PEGA O CONTEUDO DO CLIPBOARD */
sel = ReadClipboard(0)
/* TESTA SE FOI SELECIONADO O TEXTO */
if sel = "" then do
RequestNotify 'You need select text first...'
exit
end
call open(1, tmpclip, 'W')
call writeln(1, sel)
call close(1)
/* COLOCA COMO DEFAULT PORTUGUES TO ENGLISH */
if traduz = "" then do
Result = ""
WIZARDREQ TITLE "Freedom Translator Menu 1" LABEL "Select direction of your translation?" BUTTON 1 "Eng->Fra" BUTTON 2 "Eng->Deu" BUTTON 3 "Eng->Ita" BUTTON 4 "Eng->Por" BUTTON 5 "_Others Directions"
Select
When Result = -1 then exit
When Result = 1 then do; traduz = 0; INICIO(); end
When Result = 2 then do; traduz = 1; INICIO(); end
When Result = 3 then do; traduz = 2; INICIO(); end
When Result = 4 then do; traduz = 3; INICIO(); end
When Result = 5 then do
Result = ""
WIZARDREQ TITLE "Freedom Translator Menu 2" LABEL "Select direction of your translation?" BUTTON 1 "Eng->Esp" BUTTON 2 "Fra->Eng" BUTTON 3 "Deu->Eng" BUTTON 4 "Ita->Eng" BUTTON 5 "_Others Directions"
Select
When Result = -1 then exit
When Result = 1 then do; traduz = 4; INICIO(); end
When Result = 2 then do; traduz = 5; INICIO(); end
When Result = 3 then do; traduz = 6; INICIO(); end
When Result = 4 then do; traduz = 7; INICIO(); end
When Result = 5 then do
Result = ""
WIZARDREQ TITLE "Freedom Translator Menu 3" LABEL "Select direction of your translation?" BUTTON 1 "Esp->Eng" BUTTON 2 "Por->Eng"
Select
When Result = -1 then exit
When Result = 1 then do; traduz = 8; INICIO(); end
When Result = 2 then do; traduz = 9; INICIO(); end
end
end
end
end
end /* SELECT MENU 1 */
end
INICIO()
INICIO:
/* EXECUTA O FTRANSLATOR COM OS ARGUMENTOS DA TRADUCAO */
comando = 'C:FTranslator FILE 'traduz' "'tmpclip'" SILENCE > 'tmpfile
Address Command comando
Address Command 'Delete "'tmpclip'"'
NEW PORTNAME 'WORDWORTH.FTRANS'
ADDRESS VALUE RESULT
ADDRESS 'WORDWORTH.FTRANS'
OPEN FILENAME tmpfile
Address Command 'Delete "'tmpfile'"'
exit